#ifndef COLLABORATIVE_DESIGN_PLUGIN_H
#define COLLABORATIVE_DESIGN_PLUGIN_H

#include "FITKAbstractPlugin.h"
#include <QObject>
#include <QString>
#include <QLibrary>

// 声明插件API导出宏
#ifdef WIN32
#define COLLABORATIVE_PLUGIN_API __declspec(dllexport)
#else
#define COLLABORATIVE_PLUGIN_API
#endif

// 前向声明
namespace CollaborativeDesign {
    class VersionControl;
    class CollaborationManager;
    class SyncManager;
    class PermissionManager;
}

// 协同设计插件类
class CollaborativeDesignPlugin : public AppFrame::FITKAbstractPlugin
{
public:
    explicit CollaborativeDesignPlugin(QLibrary* dylibrary);
    virtual ~CollaborativeDesignPlugin();

    // 获取插件名称
    virtual QString getPluginName() override;
    
    // 执行插件功能
    virtual bool exec() override;

private:
    // 安装插件
    virtual void install() override;
    
    // 卸载插件
    virtual void unInstall() override;

    // 创建UI界面
    void createUI();
    
    // 初始化协同服务
    void initCollaborationServices();

private:
    // 版本控制系统
    CollaborativeDesign::VersionControl* m_versionControl;
    
    // 协作管理器
    CollaborativeDesign::CollaborationManager* m_collaborationManager;
    
    // 数据同步管理器
    CollaborativeDesign::SyncManager* m_syncManager;
    
    // 权限管理器
    CollaborativeDesign::PermissionManager* m_permissionManager;
};

// 插件识别和加载的C接口
extern "C" {
    COLLABORATIVE_PLUGIN_API QString FITKLibraryRecognizeFun();
    COLLABORATIVE_PLUGIN_API AppFrame::FITKAbstractPlugin* FITKLibraryLoadFun(QLibrary* lib);
}

#endif // COLLABORATIVE_DESIGN_PLUGIN_H 